#ifndef DOWNLOAD_MGR_H
#define DOWNLOAD_MGR_H

#include <fstream>
#include <iostream>
#include <string>



#include "iTube_GUI.h"

#ifndef _DOWNLOAD_
#define _DOWNLOAD_
#include <wx/socket.h>
#include <wx/stream.h>
#include <wx/file.h>
#include <wx/url.h>

#endif


#include "DownloadThread.h"




class DownloadMgr
	{
	public:
		DownloadMgr();
		DownloadMgr(wxString url, wxString Id, wxWindow* parent);
		DownloadMgr(wxArrayString urls, wxArrayString Ids, wxWindow* parent);
		~DownloadMgr();

		void AddUrl(wxString url,wxString Id);
		void AddUrls(wxArrayString urls, wxArrayString Ids);

		int GetQueueCount();
		int GetCurrentDownload(); //returns an index of the current download
		bool LastDownload(); //returns true if mgr is on the last download in the queue

		bool ExistsInQueue(unsigned int index); //returns true if the index exists in the queue
		bool CheckQueueAndIdCount(); //returs true if queue and urlIds have same # items
		wxString Download(int index); //will download the selected index

		bool VerifyFLVFile(wxString filename);  //checks if a downloaded file is a .flv 
	
	private:
		
		void SetWinParent(wxWindow* parent);
		wxArrayString UrlQueue;
		wxArrayString UrlIds;
		int CurrentIndex;
		wxWindow* d_Parent;

		bool DownloadState; //true if downloading, false if not downloading
	};


#endif


